{ "GTK_NOTEBOOK_TAB", GTK_TARGET_SAME_APP, 0 },
};
-#ifdef G_DISABLE_CHECKS
-#define CHECK_FIND_CHILD(notebook, child) \
- gtk_notebook_find_child (notebook, child, G_STRLOC)
-#else
-#define CHECK_FIND_CHILD(notebook, child) \
- gtk_notebook_find_child (notebook, child, NULL)
-#endif
/*** GtkNotebook Methods ***/
static gboolean gtk_notebook_select_page (GtkNotebook *notebook,
static gint gtk_notebook_page_compare (gconstpointer a,
gconstpointer b);
static GList* gtk_notebook_find_child (GtkNotebook *notebook,
- GtkWidget *child,
- const gchar *function);
+ GtkWidget *child);
static GList * gtk_notebook_search_page (GtkNotebook *notebook,
GList *list,
gint direction,
gboolean fill;
/* not finding child's page is valid for menus or labels */
- if (!gtk_notebook_find_child (GTK_NOTEBOOK (container), child, NULL))
+ if (!gtk_notebook_find_child (GTK_NOTEBOOK (container), child))
return;
switch (property_id)
gboolean fill;
/* not finding child's page is valid for menus or labels */
- list = gtk_notebook_find_child (notebook, child, NULL);
+ list = gtk_notebook_find_child (notebook, child);
if (!list)
{
/* nothing to set on labels or menus */
{
if (gtk_widget_get_parent (page_child) == GTK_WIDGET (container))
{
- GList *list = gtk_notebook_find_child (notebook, page_child, NULL);
+ GList *list = gtk_notebook_find_child (notebook, page_child);
if (list != NULL)
{
GtkNotebookPage *page = list->data;
static GList*
gtk_notebook_find_child (GtkNotebook *notebook,
- GtkWidget *child,
- const gchar *function)
+ GtkWidget *child)
{
- GtkNotebookPrivate *priv = notebook->priv;
- GList *list = g_list_find_custom (priv->children, child,
- gtk_notebook_page_compare);
-
-#ifndef G_DISABLE_CHECKS
- if (!list && function)
- g_warning ("%s: unable to find child %p in notebook %p",
- function, child, notebook);
-#endif
-
- return list;
+ return g_list_find_custom (notebook->priv->children,
+ child,
+ gtk_notebook_page_compare);
}
static void
guint page_num)
{
GtkNotebookPrivate *priv = notebook->priv;
- GList *list = gtk_notebook_find_child (notebook, GTK_WIDGET (child), NULL);
+ GList *list = gtk_notebook_find_child (notebook, GTK_WIDGET (child));
GtkNotebookPage *page = GTK_NOTEBOOK_PAGE (list);
gboolean child_has_focus;
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
- list = CHECK_FIND_CHILD (notebook, child);
- if (!list)
- return NULL;
+ list = gtk_notebook_find_child (notebook, child);
+ g_return_val_if_fail (list != NULL, NULL);
if (GTK_NOTEBOOK_PAGE (list)->default_tab)
return NULL;
priv = notebook->priv;
- list = CHECK_FIND_CHILD (notebook, child);
- if (!list)
- return;
+ list = gtk_notebook_find_child (notebook, child);
+ g_return_if_fail (list != NULL);
/* a NULL pointer indicates a default_tab setting, otherwise
* we need to set the associated label
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
- list = CHECK_FIND_CHILD (notebook, child);
- if (!list)
- return NULL;
+ list = gtk_notebook_find_child (notebook, child);
+ g_return_val_if_fail (list != NULL, NULL);
if (GTK_NOTEBOOK_PAGE (list)->default_menu)
return NULL;
priv = notebook->priv;
- list = CHECK_FIND_CHILD (notebook, child);
- if (!list)
- return;
+ list = gtk_notebook_find_child (notebook, child);
+ g_return_if_fail (list != NULL);
page = list->data;
if (page->menu_label)
priv = notebook->priv;
- list = CHECK_FIND_CHILD (notebook, child);
- if (!list)
- return;
+ list = gtk_notebook_find_child (notebook, child);
+ g_return_if_fail (list != NULL);
page = list->data;
expand = expand != FALSE;
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
g_return_if_fail (GTK_IS_WIDGET (child));
- list = CHECK_FIND_CHILD (notebook, child);
+ list = gtk_notebook_find_child (notebook, child);
g_return_if_fail (list != NULL);
if (expand)
priv = notebook->priv;
- list = CHECK_FIND_CHILD (notebook, child);
- if (!list)
- return;
+ list = gtk_notebook_find_child (notebook, child);
+ g_return_if_fail (list != NULL);
max_pos = g_list_length (priv->children) - 1;
if (position < 0 || position > max_pos)
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), FALSE);
g_return_val_if_fail (GTK_IS_WIDGET (child), FALSE);
- list = CHECK_FIND_CHILD (notebook, child);
- if (!list)
- return FALSE;
+ list = gtk_notebook_find_child (notebook, child);
+ g_return_val_if_fail (list != NULL, FALSE);
return GTK_NOTEBOOK_PAGE (list)->reorderable;
}
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
g_return_if_fail (GTK_IS_WIDGET (child));
- list = CHECK_FIND_CHILD (notebook, child);
- if (!list)
- return;
+ list = gtk_notebook_find_child (notebook, child);
+ g_return_if_fail (list != NULL);
reorderable = reorderable != FALSE;
g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), FALSE);
g_return_val_if_fail (GTK_IS_WIDGET (child), FALSE);
- list = CHECK_FIND_CHILD (notebook, child);
- if (!list)
- return FALSE;
+ list = gtk_notebook_find_child (notebook, child);
+ g_return_val_if_fail (list != NULL, FALSE);
return GTK_NOTEBOOK_PAGE (list)->detachable;
}
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
g_return_if_fail (GTK_IS_WIDGET (child));
- list = CHECK_FIND_CHILD (notebook, child);
- if (!list)
- return;
+ list = gtk_notebook_find_child (notebook, child);
+ g_return_if_fail (list != NULL);
detachable = detachable != FALSE;